//1、导入 request请求工具
import axios from "@/utils/request";
// 2、导入路径 path
import path from "./path";


//定义一个api对象
const api = {
   //查询所有妆造信息
    add(recordData){
        return axios.post(path.baseUrl + path.addRecord,recordData)
    },
    getById(id){
        return axios.get(path.baseUrl + path.getRecordById + "?userId=" + id)
    },
    updateOldTime(data){
        return axios.put(path.baseUrl + path.updateOldTime,data)
    },
    //获取记录带分页
    getByPage(page){
        return axios.get(path.baseUrl + path.getRecordByPage,{params:page})
    },
    //修改记录
    update(record){
        return axios.put(path.baseUrl + path.updateRecord,record)
    },
    //删除记录
    delete(id){
        console.log(id)
        return axios.delete(path.baseUrl + path.deleteRecord + "?id=" + id)
    },
    getByPageAnMake(page){
        return axios.get(path.baseUrl + path.getByPageAnMake,{params:page})
    },
   
}

//导出api
export default api;